package com.zscg.sequence.disposer;

import com.zgcs.sequence.net.in.CurrentSequencePackage;
import com.zgcs.sequence.net.in.ExitRoomSelfPackage;
import com.zgcs.sequence.net.in.InPackage;
import com.zgcs.sequence.net.in.JoinRoomPackage;
import com.zgcs.sequence.net.in.LoginPackage;
import com.zgcs.sequence.net.in.RegistPackage;
import com.zgcs.sequence.net.in.RoomListPackage;
import com.zgcs.sequence.net.in.RoomUsersPackage;
import com.zgcs.sequence.net.in.StartGamePackage;
import com.zgcs.sequence.tool.ServiceTool;

public final class DisposerManager {

	public static InPackage DisposerOrder(String order) {
		String type = order.substring(0, order.indexOf(ServiceTool.SPLIT));

		if (type.equals(ServiceTool.ORDER_RISG)) {
			return new StartGamePackage(order);
		} else if (type.equals(ServiceTool.ORDER_UL)) {
			return new LoginPackage(order);
		} else if (type.equals(ServiceTool.ORDER_RI)) {
			return new RoomListPackage(order);
		} else if (type.equals(ServiceTool.ORDER_RU)) {
			return new RoomUsersPackage(order);
		} else if (type.equals(ServiceTool.ORDER_RGA)) {
			return new JoinRoomPackage(order);
		} else if (type.equals(ServiceTool.ORDER_RISO)) {
			return new ExitRoomSelfPackage(order);
		} else if (type.equals(ServiceTool.ORDER_UR)) {
			return new RegistPackage(order);
		}else if (type.equals(ServiceTool.ORDER_RICU)) {
			return new CurrentSequencePackage(order);
		}
		return null;
	}

}
